package net.coding.bamboo.wex.cmember;

import com.weihui.basic.lang.common.domain.OperationEnvironment;
import com.weihui.finance.fundmanage.core.common.utils.ObjectMapperUtils;
import com.weihui.finance.member.client.api.BankCardClient;
import com.weihui.finance.member.client.impl.BankCardClientImpl;
import com.weihui.finance.member.client.model.request.QueryBankCardRequest;
import com.weihui.finance.member.client.model.response.QueryBankCardResponse;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * 参考wiki：http://wiki.weihui.com:9080/pages/viewpage.action?pageId=7046385
 *
 * @author : zenghua
 * @version : v0.1 MemberClientTest.java
 * @since : 2017/7/11 10:02
 */
public class MemberClientTest {
    private static BankCardClient bankCardClient;

    @BeforeClass
    public static void beforeClass() {
        bankCardClient = new BankCardClientImpl("http://10.65.209.30:9027/member");
    }

    @Test
    public void testQueryBank() {
        OperationEnvironment operationEnvironment = new OperationEnvironment();
        operationEnvironment.setClientId("fundmanage");
        operationEnvironment.setServerName("资金管理服务");
//        operationEnvironment.setClientIp("192.168.1.157");
//        operationEnvironment.setServerIp("192.168.1.157");

        QueryBankCardRequest queryBankCardRequest = new QueryBankCardRequest();
        queryBankCardRequest.setPartnerId("200005493433");
        queryBankCardRequest.setMemberId("10000001428294");
        queryBankCardRequest.setCardId("294507");
        queryBankCardRequest.setMask(false);
        QueryBankCardResponse queryBankCardResponse = bankCardClient.queryBankCard(operationEnvironment, queryBankCardRequest);
        System.out.println(ObjectMapperUtils.objectToJsonString(queryBankCardResponse.getBankCardList()));
    }
}
